{extends file="backend/index.tpl"}
{block name="page-content"}
<div class="page-header">
    <div class="icon">
        <span class="ico-pen-2"></span>
    </div>
    <h1>HÌNH ẢNH <small>QUẢN LÝ HÌNH ẢNH</small></h1>
</div>
<form id="validate" action="{$base_url}admin/image/listImage" method="post" enctype="multipart/form-data">
<div class="row-fluid">
    <div class="span12">
        <div class="block">
            <div class="head">
                <h2>Thêm Hình Ảnh</h2>
            </div>
            <div class="data-fluid">
                <div class="row-form">
                    <div class="span2">File Name</div>
                    <div class="span4">
                        <div class="input-append file" style="width: 300px;">
                            <input type="file" name="filename" style="width: 298px;"/>
                            <input type="text"/>
                            <span class="btn">Browse</span>
                        </div>  
                    </div>
                </div>
                <div class="row-form">
                    <div class="span2">Alt</div>
                    <div class="span6">
                        <input type="text" id="alt" name="alt" />
                    </div>
                </div>
                <div class="row-form">
                    <div class="span2">Title</div>
                    <div class="span6">
                        <input type="text" id="title" name="title" />
                    </div>
                </div>
                <div class="toolbar bottom tac">
                    <div class="btn-group">
                        <button class="btn btn-info" type="button" onClick="$('#validate').validationEngine('hide');">Ẩn Thông Báo</button>
                        <button class="btn" type="submit" name="submit" id="addBook">Thêm Hình Ảnh</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</form>
<div class="row-fluid">
    <div class="span12">
        <div class="block">
          
            <div class="head dblue">
                <div class="icon"><span class="ico-layout-9"></span></div>
                <h2>Danh Sách Hình Ảnh</h2>
                <ul class="buttons">
                    <li><a href="#" onClick="source('table_sort_pagination'); return false;">
                        <div class="icon"><span class="ico-info"></span></div>
                    </a></li>
                </ul>
            </div>
            <div class="data-fluid">
                <table class="table lcnp" id="listGame" cellpadding="0" cellspacing="0" width="100%">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th width="20%">File Name</th>
                            <th width="20%">Alt</th>
                            <th width="20%">Title</th>
                            <th>Width</th>
                            <th>Height</th>
                            <th width="20%">Type</th>
                            <th class="TAC" width="40">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                    {foreach from=$listImage item=image}
                        <tr class="edit_tr">
                            <td width="5%">{$image.id}</td>
                            <td width="15%">{$image.filename}</td>
                            <td width="15%">{$image.alt}</td>
                            <td width="15%">{$image.title}</td>
                            <td width="10%">{$image.width}</td>
                            <td width="10%">{$image.height}</td>
                            <td width="10%">{$image.type}</td>
                            <td>
                                <a href="{$base_url}admin/delete-image/{$image.id}" class="button red" onclick="return confirm('Bạn có muốn xóa tiếp không?')">
                                    <div class="icon"><span class="ico-remove"></span></div>
                                </a>
                            </td>
                        </tr>
                    {/foreach}
                    </tbody>
                </table>
            </div>
            <div class="pagination" style="text-align:center;">
                {$pageList}
              </div>
        </div>
    </div>
</div>

{/block}
